package licode.unisop.types.event.impl;

import licode.unisop.types.event.DomainEvent;
import licode.unisop.types.event.DomainEventHandler;
import licode.unisop.types.event.DomainEventSubscribe;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class DomainEventSubscribeImpl implements DomainEventSubscribe {
    @Resource
    private EventStoreDefault eventStoreDefault;

    @Override
    public <T extends DomainEvent> void subscribe(Class<T> domainCls,
                                                  DomainEventHandler eventHandler) {
        eventStoreDefault.subscribe(domainCls, eventHandler);
    }
}
